package com.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.health.entity.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author KunKa
 * @since 2021-03-07
 */
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {

    @Select("SELECT m.id, m.title, m.icon, m.href, m.target FROM menu m where m.is_top = 1")
    List<Menu> selectMenuList(HashMap<String, Object> param);

    @Select("SELECT title, href from index_config where type = 0 and role = #{role}")
    Map<String, Object> selectHomePage(String role);

    @Select("SELECT title, href, image from index_config where type = 1 and role = #{role}")
    Map<String, Object> selectLogoConfig(String role);

}
